package com.usian.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.usian.mapper.UserMapper;
import com.usian.pojo.User;
import com.usian.pojo.UserVo;
import com.usian.service.UserService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Override
    public List<User> findAll() {
        List<User> list = list();
        return list;
    }

    @Override
    public Page findPage(UserVo userVo) {
        Page<User> userPage = new Page<>(userVo.getPage(), userVo.getSize());
        Page<User> page = page(userPage);
        return userPage;
    }
}
